home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 3 #8
/
Commodore_Disk_User_Vol.3_8_1990_-.d64
/
macro editor
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
15KB
|
537 lines
100 rem * macro editor *
110 rem * for use with *
120 rem * sid sequencer *
130 rem * by v.h.berry *
140 rem * c.1989 *
200 gosub 50010:rem initialisation
210 gosub 35010:rem main menu
220 print"[147]macro editor."
230 print"v.h.berry."
240 print"c.1989."
250 end
5000 rem tempo change
5010 vl=peek(49275):vl=vl+i:if vl=256 then vl=1
5020 if vl=0 then vl=255
5030 poke 49275,vl:poke 49276,0
5040 return
6000 rem sequencer on/off
6010 if mf=0 then mf=1:sys 49235:return
6020 mf=0:sys 49209:return
15000 rem block editor
15010 gosub 27010:rem edit screen
15100 get k$:if k$="" then 15100
15102 if k$="" then gosub 16030:sy=sy+1:gosub 16010:rem edit cursor down
15104 if k$="[145]" then gosub 16030:sy=sy-1:gosub 16010:rem edit cursor up
15106 if k$="" then gosub 16030:sx=sx+1:gosub 16010:rem edit cursor right
15108 if k$="[157]" then gosub 16030:sx=sx-1:gosub 16010:rem edit cursor left
15110 if k$="[147]" then gosub 16510:gosub 27010:rem clear channel
15120 if k$="" then gosub 17010:gosub 27010:rem delete block
15130 if k$="" then gosub 18010:rem write block
15135 if k$="" then gosub 16610:rem set begin marker
15136 if k$="" then gosub 16610:rem set end marker
15140 if k$="" then gosub 17510:rem insert block
15145 if k$="" then poke fsid,0:poke fsid+7,0:poke fsid+14,0:rem reset note counters
15150 if k$="f" then gosub 30010:gosub 27010:rem change filename
15160 if k$="p" then pg=pg+1:gosub 27010:rem next page
15165 if k$="[208]" then pg=pg-1:gosub 27010:rem previous page
15167 if k$="+" then i=-1:gosub 5010:rem increase tempo
15168 if k$="-" then i=1:gosub 5010:rem decrease tempo
15170 if k$=chr$(133) then os=os+1:gosub 27010:rem f1 next channel
15180 if k$=chr$(134) then gosub 28010:rem f3 help screen
15190 if k$=chr$(135) then gosub 6010:rem f5 sequencer on/off
15200 if k$=chr$(136) then return:rem f7 exit
15210 goto 15100
16000 rem cursor control
16010 if sx>7 then sx=0
16015 if sx<0 then sx=7
16020 if sy>7 then sy=0
16025 if sy<0 then sy=7
16030 y$="":print"";
16040 for i=0 to sy
16050 print"";
16060 next
16070 for i=0 to sx
16080 print"";
16090 next
16100 open 1,3
16110 for i=1 to 3
16120 get#1,x$
16130 y$=y$+x$
16140 next
16150 close 1
16155 if fg=0 then print"";:fg=1:goto 16160
16156 fg=0
16160 print"[157][157][157]";y$;"[146]"
16170 return
16500 rem clear channel
16510 print" clear channel data : press [return] [146]"
16520 get k$:if k$="" then 16520
16530 if k$<>chr$(13) then k$="":return
16540 n(os)=0
16550 poke ch+(os-1)*256,128
16560 poke ch+(os-1)*256+1,255
16570 return
16600 rem set block markers
16610 vl=pg*64+sy*8+sx:if vl>=n(os) then return
16620 if k$="" then bm=vl
16630 if k$="" then em=vl
16640 gosub 16710:rem print block values
16650 gosub 21030:rem colour subroutine
16660 return
16700 rem print block marker values
16710 print" [145]"
16720 print"block:";bm+1;"-";em+1
16730 return
17000 rem delete block
17010 print" delete block [146] "
17020 if bm>em then 18310:rem block error
17030 if mf=1 then gosub 6010:rem seq. off
17040 i=0
17050 poke ch+(os-1)*256+bm+i,peek(ch+(os-1)*256+em+i+1)
17060 if peek(ch+(os-1)*256+bm+i)=255 then n(os)=n(os)-(em-bm+1):return
17070 i=i+1
17080 goto 17050
17500 rem insert block
17510 vl=pg*64+sy*8+sx:if vl>n(os) then return
17520 if vl>254 or n(os)+em-bm>255 then 18410:rem overflow
17525 if bm>em then 18310:rem block error
17526 print" insert block [146] "
17530 if mf=1 then gosub 6010:rem seq. off
17540 for i=n(os)+1 to vl step -1
17550 poke ch+(os-1)*256+i+(em-bm)+1,peek(ch+(os-1)*256+i)
17560 next
17570 if bm>vl then gosub 18110:rem copy up
17575 if em<vl then gosub 18210:rem copy down
17580 n(os)=n(os)+(em-bm)+1
17590 gosub 27010:rem edit screen
17600 return
18000 rem write block
18010 vl=pg*64+sy*8+sx:if vl>n(os) then return
18020 if vl>254 or vl+em-bm>254 then 18410:rem overflow
18025 if bm>em then 18310:rem block error
18026 print" write block [146] "
18030 if mf=1 then gosub 6010:rem seq. off
18040 if em<vl or bm>vl then gosub 18110:rem copy up
18050 if em>vl or bm<vl then gosub 18210:rem copy down
18060 if vl+em-bm<n(os) then 18090
18070 n(os)=vl+em-bm+1
18080 poke ch+(os-1)*256+n(os),255
18090 gosub 27010:rem edit screen
18095 return
18100 rem copy up
18110 i=0
18120 for j=bm to em
18130 if k$="" then poke ch+(os-1)*256+vl+i,peek(ch+(os-1)*256+j)
18135 if k$="" then poke ch+(os-1)*256+vl+i,peek(ch+(os-1)*256+j+(em-bm)+1)
18140 i=i+1
18150 next
18160 return
18200 rem copy down
18210 i=0
18220 for j=em to bm step -1
18230 poke ch+(os-1)*256+vl+em-bm+i,peek(ch+(os-1)*256+j)
18240 i=i-1
18250 next
18260 return
18300 rem block marker error
18310 print" block marker error [146]"
18320 gosub 21030:rem colour subroutine
18330 return
18400 rem data overflow error
18410 print" overflow error [146]"
18420 gosub 21030:rem colour subroutine
18430 return
21000 rem colour subroutine
21030 if os>3 then os=1
21040 if os=1 then print""
21050 if os=2 then print"[158]"
21060 if os=3 then print""
21070 return
27000 rem note edit screen
27010 print"[147] next chan help seq on/off exit "
27020 print" f1 f3 f5 f7 "
27070 print"[176][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][174]"
27080 print"{$7d}1{$7d}2{$7d}3{$7d}4{$7d}5{$7d}6{$7d}7{$7d}8{$7d}"
27090 print"[176]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27100 print"{$7d}0+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27110 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27120 print"{$7d}8+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27130 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27140 print"{$7d}16+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27150 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27160 print"{$7d}24+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27170 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27180 print"{$7d}32+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27190 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27200 print"{$7d}40+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27210 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27220 print"{$7d}48+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27230 print"[171]{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}{$7b}{$60}{$60}{$60}[179]"
27240 print"{$7d}56+{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}{$7d}"
27250 print"[173]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[177]{$60}{$60}{$60}[189]"
27260 print"file:";n$
27265 gosub 16710:rem print block values
27270 gosub 21030:rem colour subroutine
27280 print"channel:";os
27285 if pg*64>n(os) then pg=0
27286 if pg<0 then pg=int((n(os)-1)/64)
27290 print"notes:page:[145]"
27300 print tab(9);n(os);tab(24);pg*64+1;"-";(pg+1)*64
27302 rem initialise cursor controls
27304 sx=0:sy=0:fg=0
27310 rem print note data
27320 i=0:ll=0:print"";
27330 vl=peek(ch+(os-1)*256+pg*64+i)
27340 if vl=128 then nl$="r ":goto 27385:rem rest
27350 if vl=255 then nl$=": ":goto 27385:rem end of data
27360 gosub 27510:rem note/octave string
27385 print nl$;"";
27390 i=i+1:if i=64 or vl=255 then gosub 16030:return
27395 ll=ll+1:if ll=8 then ll=0:print:print"";
27400 goto 27330
27500 rem note letter/octave string
27510 ov=int(vl/16):rem octave
27520 o$=str$(ov):o$=right$(o$,1)
27530 nl$=l$(vl-ov*16):rem note letter name
27540 nl$=nl$+o$:if len(nl$)=2 then nl$=nl$+" "
27550 return
28000 rem help screen
28010 poke 53280,5:poke 53281,5:print"[147]";
28011 print" press [f7] to exit : [176]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
28012 print"[192][192][192][192][192][192][192][192][192][174][221][f][146][144]cha";
28013 print"ngefilename{$7d}{$7d}{$7d}{$7d}[p]";
28014 print"[146][144]nextpage{$7d}{$7d}[shift] & [p][146][144]previouspage";
28015 print"{$7d}{$7d}{$7d}{$7d}[+][146][144]increas";
28016 print"etempo{$7d}{$7d}[-][146][144]decreasetempo{$7d}{$7d}";
28017 print"{$7d}{$7d}[home][146][144]resetnotecounters";
28018 print"{$7d}{$7d}{$7d}{$7d}[146][144]editcontrols:[crsr][146]";
28019 print"[144]movecursor{$7d}{$7d}[146][144]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$7d}{$7d}[ctrl] &";
28020 print" [b][146][144]'begin'blockmark{$7d}{$7d}[ctrl] & [e][146][144]'end'blockmark";
28021 print"{$7d}{$7d}{$7d}{$7d}[ctrl] & [d][146][144]delete";
28022 print"block{$7d}{$7d}[ctrl] & [w][146][144]writeblockatcrsr{$7d}{$7d}[ctrl] &";
28023 print" [i][146][144]insertblockatcrsr{$7d}{$7d}";
28024 print"[221][221][shift] & [clr][146][144]clearchannel[221]";
28025 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
28026 print"[192][192][192][192][192][192][192][192][192][189]"
28160 get k$:if k$="" then 28160
28170 if k$<>chr$(136) then 28160
28180 k$=""
28190 poke 53280,0:poke 53281,0
28200 gosub 27010:rem note edit ecreen
28210 return
30000 rem input new filename
30010 poke 53280,5:poke 53281,5
30020 print"[147] enter new filename : press [return] [146]";
30030 print
30040 print"file : ";n$
30050 print""
30060 l=14:tb=5:rs=1:gosub 32040:rem input subroutine
30070 if a>0 then n$=y$
30080 poke 53280,0:poke 53281,0
30090 return
32000 rem input restriction subroutine
32010 rem l=length of input
32020 rem tb=tabulation of routine
32030 rem rs=character restrictions
32040 a=0:y$="":sp=1
32050 print tab(tb+l+1):print"[145][174][157][189][145]";:for x=0 to l+1:print"[157][157] ";:next:print"[145][176][157][173][145][144][164][157]";
32060 get x$:if x$="" then 32060
32070 if x$=chr$(160) or x$=" " or x$=chr$(20) or x$=chr$(13) then 32130
32080 if rs=0 then if x$=>"0" and x$=<"9" then 32130
32090 if rs=1 and x$=>chr$(35) and x$=<chr$(93) then 32130
32100 goto 32060
32110 if a=l-1 then print"[157][157]";
32120 goto 32060
32130 if x$=chr$(20) and a=0 then 32060
32140 if x$=chr$(13) and right$(y$,1)=" " then y$=left$(y$,len(y$)-1):a=a-1
32150 if x$=chr$(13) then print:return
32160 a=a+1:if x$<>chr$(32) then sp=0
32170 if a>l and x$<>chr$(20) then x$="":a=a-1
32180 if a<1 then x$="":a=0
32190 if x$=chr$(20) then print tab(a)"[157][164] [157][157]";:a=a-2:y$=left$(y$,len(y$)-1):goto 32110
32200 if x$=chr$(32) and sp=1 then x$="":a=a-1
32210 if x$=chr$(32) then sp=sp+1
32220 y$=y$+x$:print x$;:if a<l then print"[164][157]";
32230 goto 32060
35000 rem main menu
35010 print"[147] move cursor up & down:press [return] [146]"
35020 print"***macro editor***"
35030 print"v.h.berry c.1989"
35040 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
35060 print" macro editor "
35070 print" hardcopy "
35080 print" disk menu "
35090 print" exit program "
35100 print
35110 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
35120 print"":t1=10:ll=3:gosub 39010:rem menu system routine
35130 if a=3 then return
35140 on a+1 gosub 15010,36010,37020
35150 goto 35010
36000 rem hardcopy menu
36010 print"[147] move cursor up & down:press [return] [146]"
36020 print"*** hardcopy ***"
36030 print"file : ";n$
36040 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
36050 print" new filename "
36060 print" horizontal print"
36070 print" vertical print "
36080 print" exit menu "
36090 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
36100 print"":t1=10:ll=3:gosub 39010:rem menu system routine
36110 if a=3 then return
36120 on a+1 gosub 30010,46010,47010
36130 goto 36010
37000 rem disk menu
37020 print"[147] move cursor up & down:press [return] [146]"
37030 print"*** disk menu ***"
37040 print"file : ";n$
37050 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
37060 print" new filename "
37070 print" load sid "
37090 print" load music "
37095 print" append music "
37100 print" save music "
37110 print" disk commands "
37120 print" exit menu "
37130 print
37140 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
37150 print"":t1=10:ll=6:gosub 39010:rem menu system routine
37160 if a=6 then return
37165 if a>0 and a<6 and mf=1 then gosub 6010:rem turn off sequencer
37170 on a+1 gosub 30010,42010,40010,40010,41010,45010
37180 goto 37020
38000 rem disk command menu
38010 print"[147] move cursor up & down:press [return] [146]"
38020 print"***disk commands***"
38030 print"file : ";n$
38040 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
38045 print" disk directory "
38050 print" intialise disk "
38060 print" scratch sid "
38070 print" scratch music "
38080 print" scratch both "
38090 print" validate disk "
38100 print" exit menu "
38110 print
38120 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
38130 print"":t1=10:ll=6:gosub 39010:rem menu system routine
38140 return
38500 rem directory menu
38505 if dy*12>fi then dy=0
38510 print"[147] move cursor up & down:press [return] [146]"
38520 print"***disk directory***"
38525 print"blocks free : ";bf
38530 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
38540 print" ";n$;""
38550 for i=12*dy to 11+(12*dy)
38555 if i>fi then print:goto 38570
38560 print" ";fi$(i)
38570 next i
38575 print" next page"
38580 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
38590 print"":t1=10:ll=13:gosub 39010:rem menu system routine
38592 if a=13 then dy=dy+1:goto 38505
38593 if a=0 then 38600
38594 if len(fi$((a-1)+12*dy))<3 then 38600
38595 n$=left$(fi$((a-1)+12*dy),len(fi$((a-1)+12*dy))-2)
38600 return
39000 rem menu system routine
39010 a=0:print tab(t1);">"
39020 get x$:if x$="" then 39020
39030 if a=ll and x$=chr$(17) then a=a-1:print"[145][145]"
39040 if a=0 and x$=chr$(145) then a=a+1:print
39050 if x$=chr$(17) then a=a+1:print tab(t1);"[145] [157]>"
39060 if x$=chr$(145) then a=a-1:print tab(t1);"[145] [157][145]>"
39070 if x$=chr$(13) then return
39080 goto 39020
40000 rem load music file
40010 x$=".1":i=0:fg=0:if a=3 then fg=1
40020 n=0:if fg=1 then n=n(i+1)
40030 open 15,8,15
40040 open 2,8,2,n$+x$+",s,r"
40050 input#15,en,er$,tr,se
40060 if en<>0 then print"[147] load[146]";:goto 44010
40070 print" loading music file : [146]";
40080 input#2,a
40090 poke ch+i*256+n,a
40095 if n=255 then poke ch+i*256+n,255:goto 40110
40100 if a<>255 then n=n+1:goto 40080
40110 n(i+1)=n
40120 close 2
40130 close 15
40140 if i=0 then i=1:x$=".2":goto 40020
40150 if i=1 then i=2:x$=".3":goto 40020
40160 return
41000 rem save music file
41010 x$=".1":i=0
41020 n=0
41030 open 15,8,15
41040 open 2,8,2,n$+x$+",s,w"
41050 input#15,en,er$,tr,se
41060 if en<>0 then print"[147] save[146]";:goto 44010
41070 print" saving music file : [146]";
41080 a=peek(ch+i*256+n)
41090 print#2,a
41100 if a<>255 then n=n+1:goto 41080
41110 close 2
41120 close 15
41130 if i=0 then i=1:x$=".2":goto 41020
41140 if i=1 then i=2:x$=".3":goto 41020
41150 return
42000 rem load fsid registers
42010 open 15,8,15
42020 open 2,8,2,n$+".s,s,r"
42030 input#15,en,er$,tr,se
42040 if en<>0 then print"[147] load[146]";:goto 44010
42050 print" loading sound file : [146]";
42060 input#2,a
42070 poke 49275,a
42080 for ce=0 to 2
42090 for reg=0 to 6
42100 input#2,a
42110 poke fsid+reg+7*ce,a
42120 next reg,ce
42130 close 2
42140 close 15
42150 return
44000 rem file error routine
44010 close 2:close 15
44020 print" error : press [return] [146]";:print
44030 print"file : ";n$
44040 print"error # : ";en:print"";er$:print"tr = ";tr;" : se = ";se
44050 get k$:if k$<>chr$(13) then 44050
44060 return
45000 rem disk routines
45010 open 15,8,15
45020 gosub 38010:rem disk command menu
45030 if a=6 then close 15:return
45035 if mf=1 then gosub 6010:rem turn off sequencer
45037 if a=0 then gosub 45300:gosub 38510:goto 45020:rem directory
45040 if a>1 then 45080
45050 print" intialise disk : [146]"
45060 print#15,"i"
45070 goto 45020
45080 if a<>5 then 45120
45090 print" validate disk : [146]"
45100 print#15,"v"
45110 goto 45020
45120 if a=2 then 45160
45125 print" scratch music file : [146]"
45130 print#15,"s:"+n$+".1"
45132 print#15,"s:"+n$+".2"
45134 print#15,"s:"+n$+".3"
45150 if a=3 then 45020
45160 print" scratch sound file : [146]"
45170 print#15,"s:"+n$+".s"
45180 goto 45020
45200 rem disk directory read
45300 i=0:fi$(i)=""
45310 open 1,8,0,"$0"
45320 get#1,a$,b$
45330 get#1,a$,b$
45340 get#1,a$,b$
45350 c=0
45360 if a$<>"" then c=asc(a$)
45370 if b$<>"" then c=c+asc(b$)*256
45380 bf=c
45390 get#1,b$:if st<>0 then 45470
45400 if b$<>chr$(34) then 45390
45410 get#1,b$:if b$<>chr$(34) then fi$(i)=fi$(i)+b$:goto 45410
45420 get#1,b$:if b$=chr$(32) then 45420
45425 if right$(fi$(i),2)=".1" then fi$(i)=left$(fi$(i),len(fi$(i))-1)+"m":i=i+1
45426 if right$(fi$(i),2)=".s" then i=i+1
45427 if i=37 then 45470
45430 c$="":fi$(i)=""
45440 c$=c$+b$:get#1,b$:if b$<>"" then 45440
45450 if st=0 then 45330
45460 close 1
45470 fi=i:dy=0
45480 close 1:return
46000 rem horizontal hardcopy
46010 open 4,4
46012 print#4,chr$(27);chr$(108);chr$(6):rem left margin (col=6)
46020 print#4,"file: ";n$
46030 for os=1 to 3
46040 print#4,chr$(13)
46042 print#4,"channel:";os
46044 print#4,chr$(13);pc$;
46046 j=0:gosub 46210:rem print note#
46051 for i=0 to n(os)-1
46052 vl=peek(ch+(os-1)*256+i)
46054 if vl=128 then nl$="r ":goto 46066:rem rest
46060 gosub 27510:rem note/octave string
46066 print#4,nl$;" ";
46068 ll=ll+1:if ll=16 then j=j+4:gosub 46210:rem next line
46070 next i
46075 print#4,chr$(13)
46080 next os
46085 print#4,chr$(12)
46090 close 4
46100 return
46200 rem print note#
46210 ll=0:y$=mid$(ps$,j+1,4)
46220 print#4,chr$(13)
46230 print#4,y$;" ";
46250 return
47000 rem vertical hardcopy
47010 open 4,4
47012 print#4,chr$(27);chr$(108);chr$(4):rem left margin (col=4)
47020 print#4,"file: ";n$
47025 j=0
47030 gosub 46210:rem print note#
47035 print#4,chr$(13);" ";pc$;
47040 for os=1 to 3
47042 print#4,chr$(13)
47043 print#4,"chan";os;" ";
47050 vl=peek(ch+(os-1)*256+ll+j*4)
47060 if ll+j*4>=n(os) then 47110:rem abort line
47070 if vl=128 then nl$="r ":goto 47090:rem rest
47080 gosub 27510:rem note/octave string
47090 print#4,nl$;" ";
47100 ll=ll+1:if ll<16 then 47050
47110 ll=0
47120 next os
47130 j=j+4
47140 if j*4<n(1) or j*4<n(2) or j*4<n(3) then 47030
47150 print#4,chr$(12)
47160 close 4
47170 return
50000 rem initialisation
50010 if peek(51712)=1 then 50112:rem machine code present
50020 rem load machine code
50030 poke 53280,5:poke 53281,5
50040 print"[147][176][174]"
50050 print"macro editor"
50060 print"v.h.berryc.1989"
50070 print"[173][189]"
50080 print"loadingmachinecode"
50090 fg=fg+1:if fg=1 then load"sequencer mc",8,1
50100 if fg=2 then load "note table mc",8,1
50112 dim fi$(36)
50115 dim l$(11):rem note letter names
50120 ch=51968:rem music data address
50140 fsid=49175:rem false sid data address
50150 nh=51712:rem note table high byte
50160 nl=51840:rem note table low byte
50170 mf=0:rf=0:rem music & record flag
50210 n$="music file"
50220 pc$="note# +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15"
50230 pc$=pc$+" +16"
50240 ps$="+0 +16 +32 +48 +64 +80 +96 +112+128+144+160+176+192+208+224+240"
50282 rem read note letter names
50284 for i=0 to 11
50286 read a$
50288 l$(i)=a$
50289 next
50290 for os=1 to 3
50300 gosub 16540:rem clear channel data
50310 next
50320 os=1:rem edit voice 1
50330 poke 53280,0:poke 53281,0
50340 return
60200 rem note letter name data
60210 data "c","c#","d","d#"
60220 data "e","f","f#","g"
60230 data "g#","a","a#","b"